<layout name="Layout/layout" />

<div style="margin-bottom: 10px;">
    <a href="{:U('Admin/Privilege/add',array('pid'=>$pid,'level'=>$leve))}"><button class="btn btn-primary">新增权限</button></a>
</div>
<table id="simple-table" class="table table-striped table-bordered table-hover">
    <thead>
    <tr>
        <th class="center">序号</th>
        <th class="center">权限名称</th>
        <th class="center">模块</th>
        <th class="center">控制器</th>

        <th class="center">方法</th>
        <th class="center">父ID</th>
        <th class="center">菜单级次</th>
        <th class="hidden-480">图标</th>

        <th class="center">操作</th>
    </tr>
    </thead>

    <tbody>
    <volist name="data" id="m">
    <tr>
        <td class="center">{$m.id}</td>
        <?php if($level == 4){ ?>
        <td class="center">{$m.pri_name}</td>
        <?php }else{ ?>
        <td class="center"><a href="{:U('Admin/Privilege/lst',array('level'=>$level,'pid'=>$m['id']))}">{$m.pri_name}</a></td>
        <?php } ?>
        <td class="center">{$m.module_name}</td>
        <td class="center">{$m.controller_name}</td>
        <td class="center">{$m.action_name}</td>
        <td class="center">{$m.parent_id}</td>
        <td class="center">{$m.level}</td>
        <td class="center">{$m.icon}</td>

        <td class="center">
            <div class=" btn-group">
                <a href="{:U('Admin/Privilege/edit',array('id'=>$m['id']))}">
                <button class="btn btn-xs btn-info">
                    <i class="ace-icon fa fa-pencil bigger-120"></i>
                </button>
                </a>
                <a href="{:U('Admin/Privilege/delete',array('id'=>$m['id'],'pid'=>$m['parent_id'],'level'=>$m['level']))}">
                <button class="btn btn-xs btn-danger">
                    <i class="ace-icon fa fa-trash-o bigger-120"></i>
                </button>
                </a>
            </div>

        </td>
    </tr>
    </volist>
    </tbody>
</table>